|
|
|
|
|
|
|
agGetAddressForObject, agGetAddressForInteger, agGetAddressForLong, agGetAddressForLPSTR, agGetAddressForVBString |
|
|
|
|
|
|
|
|
Declare Function agGetAddressForObject Lib "apigid32.dll" (object As Any) As Long
Declare Function agGetAddressForInteger Lib "apigid32.dll" Alias _
"agGetAddressForObject" (intnum As Integer) As Long
Declare Function agGetAddressForLong Lib "apigid32.dll" Alias _
"agGetAddressForObject" (intnum As Long) As Long
Declare Function agGetAddressForVBString Lib "apigid32.dll" Alias _
"agGetAddressForObject" (vbstring As String) As Long |
|
|
|
|
|
|
|
|
All of these aliases call a very simple function that returns as a Long value the parameter that was passed. It can be useful in determining the value placed on the top of a stack for different parameters. It can also be used to retrieve the address of a variable when it is passed by reference, a task that is more frequently handled now using the VarPtr operator. |
|
|
|
|
|
|
|
|
agGetStringFrom2NullBuffer |
|
|
|
|
|
|
|
|
Declare Function agGetStringFrom2NullBuffer Lib "apigid32.dll" (ByVal ptr As _
Long) As String |
|
|
|
|
|
|
|
|
There are a number of API functions that load a buffer with a series of strings, where each string is separated from the next by a NULL character and the final string is followed by two NULL characters. Loading a buffer of this type into a Visual Basic string is possible using VB and API functions alone, but it is a complex task that includes using API functions to calculate the length of each string and to copy each string individually. This function takes as a parameter a pointer to a memory buffer containing a double NULL-terminated set of strings, and returns a VB string with all of the strings in a single string (still separated by NULL characters with a double NULL termination at the end). You can then parse the individual strings easily using the VB Instr and Mid$ functions. |
|
|
|
|
|
|
|
|
Declare Function agGetStringFromPointer Lib "apigid32.dll" Alias _
"agGetStringFromLPSTR" (ByVal ptr As Long) As String |
|
|
|
|
|
|
|
|
This function takes a parameter containing a memory pointer to a NULL-terminated ANSI string and returns a Visual Basic string containing the string (without |
|
|
|
|
|